
public class Tacka implements Comparable, Dogadjaj {

	private double x, y;

	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}

	public Tacka(double x, double y) {
		super();
		this.x = x;
		this.y = y;
	}
	
	public int compareTo(Object t) {
		Tacka pom = (Tacka)t;
		if (y >= pom.getY()) return 1;
		if (y < pom.getY()) return -1;
		return 0;
	}
	
	public double distanceTo(Tacka p){
		return Math.sqrt(Math.pow(Math.abs(x-p.x), 2) + Math.pow(Math.abs(y-p.y), 2));
	}
}
